<script type="text/javascript" src="/js/sms.js"></script>
<script type="text/javascript" src="/js/calendar/WdatePicker.js"></script>
<h2>系统消息&gt; 列表</h2>
<form action="<?= AdminController::_makeURL('sms','system','list') ?>" method="post">
<table class="list" cellpadding="0" cellspacing="0" with="100%">
<tr>
	<td>用户uid</td>
    <td><input type="text" name="uid" /></td>
</tr>
<tr>
	<td>按时间搜索</td>
	<td><span>开始时间：</span>
<input id="start" name="start" class="Wdate" type="text" onFocus="var end=$dp.$('end');WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked:function(){end.focus();},maxDate:'#F{$dp.$D(\'end\')}'})" value="<?=_('start')?>" style="width:150px"/>
<span>结束时间：</span>
<input type="text" id="end" name="end" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'start\')}'});" class="Wdate" style="width:150px" value="<?=_('end')?>"/></td>
</tr>
<tr nowrap="nowrap">
	<td colspan="2" align="center"><input type="submit" value="开始搜索"  /></td>
</tr>
</table>
</form>
<table class="list" cellpadding="0" cellspacing="0">
	<thead align="center">
		<td nowrap></td>
		<td nowrap>序号</td>
		<td nowrap>id</td>
		<td nowrap>UID</td>
		<td nowrap>用户名</td>
		<td nowrap>内容</td>		
		<td nowrap>创建时间</td>
		<td nowrap>操作</td>
	</thead>
	<?php $i=1;?>
	<? foreach($this->ret['data']['ret']['ROWS'] as $row):?>
	<tr ondblclick='$$(".sms_content").each(function(v){v.toggle();})' style="background:#fcf3d6" >
		<td><input type="checkbox" name="sms_id" id="sms_id" value="<?=$row['sms_id']?>" ></td>
		<td nowrap><?php echo $i;?></td>
		<td nowrap>
			<?= $row['sms_id'] ?>
		</td>		
		<td nowrap>
			<?= $row['recieverid']?></a>
		</td>
		<td nowrap>
			<a href="http://i.178.com/?uid=<?=$row['recieverid']?>" target="_blank"><?= $row['reciever']?></a>
		</td>
		<td onclick='$("sms_content_<?=$row['sms_id']?>").toggle()' >
			<?= mb_substr(strip_tags(sms_util_text::formatOutputContent($row['content'])), 0,20,'utf8') ?>;
		</td>
		<td nowrap>
			<?= date('Y-m-d H:i:s', $row['create_time']) ?>
		</td>
		<td nowrap>
			<a href='###' aid="<?= $row['sms_id']?>" class="delete-link">删除</a>
		</td>
	</tr>
	<tr style="display:none" id="sms_content_<?=$row['sms_id']?>" class="sms_content" >
		<td colspan="9" bgcolor="#FFFFEE">
			<script>
				UBBCode.output("<?= sms_util_text::formatOutputContent($row['content'])?>");
			</script>
		</td>
	</tr>
	<?++$i;?>
	<? endforeach;?>
</table>
<table class="list" cellpadding="0" cellspacing="0">
	<thead>
		<td nowrap>
		 <input type="checkbox" id="checkall" onclick="checkall()" /> &nbsp;&nbsp;<input type="button" id="del_sel" name="del_sel" onclick="verify_sel(9)" value="删除所选" />
        </td>
    	<td align="right" nowrap>
			<?=$this->ret['data']['pages']?>
        </td>
    </thead>
</table>
<script>
hookDeleteConfirm.hook = function(src){ return $H({_app: 'sms', _controller: 'system', _action: 'delete', id: src.getAttribute('aid')}).toQueryString();};
</script>